//
//  HeaderViewCell.m
//  ZAKER
//
//  Created by dllo  on 15/9/2.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HeaderViewCell.h"

@implementation HeaderViewCell

- (void)dealloc
{
    [_headerImage release];
    [_coinImage release];
    [_titleLabel release];
    
    [super dealloc];
}

- (UIImageView *)headerImage
{
    
    if (_headerImage == nil) {
        
        self.headerImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 375 * myWidth, 200 * myHeight)];
    }
    
    return _headerImage;
    
}

- (UIImageView *)coinImage
{
    
    if (_coinImage == nil) {
        
        self.coinImage = [[UIImageView alloc] initWithFrame:CGRectMake(_headerImage.frame.origin.x + 10 * myWidth, _headerImage.frame.origin.y + _headerImage.frame.size.height, 20 * myWidth, 30 * myHeight)];
    }
    
    return _coinImage;
}

- (UILabel *)titleLabel

{
    if (_titleLabel == nil) {
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_coinImage.frame.origin.x + _coinImage.frame.size.width + 10 * myWidth, _coinImage.frame.origin.y, self.frame.size.width - 40 * myWidth, 30 * myHeight)];
    }
    
    return _titleLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.headerImage];
        [self.contentView addSubview:self.coinImage];
        [self.contentView addSubview:self.titleLabel];
        
        [_titleLabel release];
        [_coinImage release];
        [_headerImage release];
        
    }
    
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
